            <?php  $this->load->view('admin/product/link_bar');?>
            <script>
                function loadProduct(){
                    var category=  document.getElementById('category');
                    category = category.options[category.selectedIndex].value;
                    window.location = "<?php echo base_url() ?>admin/product/view/" + category;
                   // alert(category);
                }
            </script>
          	<div class="box_function"  style="display:none">
			 <input type="text" name="txtKeyword" id="txtKeyword">  <input type="submit" name="txtKeyword" id="txtKeyword" value="Tìm">
			</div>
            <div class="box_function">
            <form method="post" action="<?php echo $this->base_url?>admin/product/delete" class="form">
              <table width="747" border="0" cellpadding="0" cellspacing="0" class="listproduct" id="listproduct">
                <tr>
                  <td width="33" class="tilte_list_pro">
				  <label>
                   <input name="checkme" class="noborder" onclick="checkDelBoxes(this.form, 'categoryBox[]', this.checked)" type="checkbox">
                  </label></td>
                  <td width="70" class="tilte_list_pro">IMAGE</td>
				   <td width="100" class="tilte_list_pro">CODE</td>
                  <td width="274" class="tilte_list_pro"><?php echo $ddlCategory ?></td>
                  <td align="center" width="20" class="tilte_list_pro">BEST SELL</td>
                  <td align="center" width="20" class="tilte_list_pro">SPECIAL</td>
                  <td align="center" width="20" class="tilte_list_pro">DISPLAY</td>
                  <td width="70" class="tilte_list_pro">ACTION</td>
                </tr>
				<?php
                                // print_r($rows);
				for($i = 0; $i < count($rows); $i++){
					$id = $rows[$i]['id_product'];
					$name = $rows[$i]['vi_name'];
					$code = $rows[$i]['code'];
					$image = $rows[$i]['image'];
					$upload_dir = getDirByDate($rows[$i]['date_add'], PRODUCT_IMAGE_PATH);
					if(!file_exists($upload_dir.'/'.$image)) $image = '';
					else $image = img(array('src'=>base_url($upload_dir.'/' .$image), 'width' => '60px', 'height'=>'60px' )); '<img src="'.  base_url().PRODUCT_IMAGE_PATH.$image.'" with="60px" height="60px">';
					$best_sell = $rows[$i]['best_sell'];
                    $special = $rows[$i]['special'];
					$active = $rows[$i]['active']== 1; // ? "checked.jpg" : "nocheck.jpg";
					$data['upload_dir'] = getDirByDate($rows[$i]['date_add'], PRODUCT_IMAGE_PATH);
                    if($i % 2 == 0) $css_class = 'row1';
                            else $css_class = 'row2';
				?>
				<tr class="<?php echo $css_class ?>">
                  <td class="product">
				  <label>
                    <input name="categoryBox[]" value="<?php echo $id?>" class="noborder" type="checkbox">
                  </label></td>
                  <td class="product"><?php echo $image?></td>
                  <td class="product"><?php echo $code?></td>
                  <td class="descriptiom"><?php echo $name?></td>
                  <td class="product">
                  <input type="checkbox" onclick="xajax_changeBestSell(<?php echo $id?>);" name="cb<?php echo $id?>" <?php echo $best_sell==1?'checked':''?>>
                  </td>
                  <td class="product">
                  <input  type="checkbox" onclick="xajax_changeSpecial(<?php echo $id?>);" name="cs<?php echo $id?>" <?php echo $special==1?'checked':''?>>
                  </td>
                  <td class="display">
                  <input type="checkbox" onclick="xajax_changeDisplay(<?php echo $id?>);" name="cd<?php echo $id?>" <?php echo $active==1?'checked':''?>>
                  </td>
                  <td class="action">
				  		<a href="<?php echo site_url('admin/product/edit/'. $id)?>">
							<img src="<?php echo $this->base_url?>images/admin/edit.gif" alt="Edit" title="Edit" border="0">
						</a>
	
						<a href="<?php echo site_url('admin/product/delete/' . $id)?>" onclick="return confirm('Delete item #<?php echo $id?>?');">
						<img src="<?php echo base_url()?>images/admin/delete.gif" alt="Delete" title="Delete" border="0">
						</a>
				  </td>
                </tr>
				<?php
				}
				?>
                                                             
              </table>
			 
			<div style="padding-top:50px">
			<br><br>
			<input class="button" name="submitDelcategory" value="Delete selection" onclick="return confirm('Delete selected items?');" type="submit">
			</div>
			  </form>
            </div>
			
			<?php echo $this->pagination->create_links();?>